<template>
    <template v-for="(item, index) in router" :key="index">
        <el-menu-item v-if="!item.children" :index="item.path">
            <template #title>
                <el-icon><icon-menu /></el-icon>
                <span>{{ item.meta.title }}</span>
            </template>

        </el-menu-item>
        <el-sub-menu v-else>
            <template #title>
                <el-icon>
                    <location />
                </el-icon>
                <span>{{ item.meta.title }}</span>
            </template>
            <MenuList :router="item.children" />
        </el-sub-menu>
    </template>
</template>
<script setup lang="ts">
import { defineProps } from 'vue'
import MenuList from "@/components/MenuList/index.vue";
defineProps(['router'])
</script>
<style></style>